<admintpl file="header"/>
<link rel="stylesheet" href="__PUBLIC__/css/jquery.datetimepicker.css">
<link rel="stylesheet" href="__PUBLIC__/css/act.css">
<link rel="stylesheet" href="__PUBLIC__/css/main.css">


<style type="text/css">
    table.cityList {
        margin: 10px 0px;
        border: 1px solid #999;
        text-align: center;
    }

    .actimg {
        width: 80px;
    }
</style>
</head>
<body>

<div class="manage">
    <span><a href="{:U('Package/index')}">运营管理</a></span>
</div>

<div class="act_main"><a href="{:U('Package/index')}">运营工具</a>

</div>
<div class="wrap">
    <div class="act_title">
        <div class="act_left">
            <span class="act_all" data-type="{$type}">
                    渠道包
            </span>

            <span class="ac_color">（
                    <?php if($list['data']['Count']){?><?php echo $list['data']['Count'];?><?php }else{ ?>0<?php } ?>个渠道包链接
                        )</span>

        </div>
        <div class="act_right">
            <ul>

               <?php if(empty($list['data']['Type']) && empty($list['data']['package']) ){ ?>
                    <li><a href="#" data-toggle="modal" data-target="#addPackage">> <span>添加渠道包</span></a></li>
                <?php }else{ ?>
                    <li><a href="{:U('Package/view',['Type'=>2])}" target="_blank">> <span>查看默认渠道包</span> </a></li>
                    <li><a href="{:U('Package/add')}" target="_blank">> <span>添加渠道包</span></a></li>
               <?php } ?>

            </ul>
        </div>
    </div>


    <table cellpadding="2" cellspacing="0" width="80%" align="center" id="timeDesc"
           class="Joperate tablesorter tablesorter-blue table table-hover table-bordered table-list">
        <thead>
        <tr role="row" class="tablesorter-headerRow">
            <th><input type="checkbox" data-id="" class="check_all_activity"></th>
            <th>渠道名称</th>
            <th><a href="#" class="" id="actid">活动链接ID</a></th>
            <th>状态</th>
            <th>微信链接</th>
            <th class="tablesorter-header tablesorter-headerUnSorted Jdesc">
                <a href="#" class="">更新时间</a><span class="desc">( <i>降序</i> )</span></th>
            <th>渠道链接</th>
        </tr>
        </thead>
        <tbody>

        <?php if(isset($list['data']['package']) && $list['data']['package']){ ?>
            <foreach name="list['data']['package']" item="vo">
                <tr>
                    <td><input type="checkbox" data-id=""></td>
                    <td class="act-name">{$vo.Name}<a class="act-view"
                                                      href="{:U('Package/view',array('ChannelId'=>$vo['ChannelId']))}"></a>
                    </td>
                    <td>{$vo.ChannelId}</td>
                    <td>{$vo.ExpirationTimeInfo}</td>
                    <td>{$vo.WeiXinUrl}</td>
                    <td>{$vo.UpdateTime}</td>
                    <td>1个链接 <a href="javascript:void(0)" class="Jcopy" data-href="">（查看链接）</a>
                        <input type="hidden" value="{$vo.url.result.url_short}" class="hidUrl"></td>

                </tr>
            </foreach>
        <?php } ?>
        </tbody>

    </table>

    <div class="act_more">
        <div class="text-center"><a href="javascript:void(0)" class="JMoreActivity">加载更多渠道包链接</a></div>
    </div>

</div>


<div class="modal fade" id="addPackage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     style="width: 600px; display: none;">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="background-color: #DCDCDC">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myShopLabel" style="color: black">添加默认渠道包</h4>
            </div>
            <div class="modal-body">
                <div class="form-horizontal">
                    <div class="control-group" style="text-align: center">
                        <p>请先添加默认渠道包。</p>
                    </div>

                    <div class="control-group" style="text-align: center">
                        <p>当普通渠道包失效时，下载普通渠道包将指向默认渠道包。</p>
                    </div>


                </div>
            </div>
            <div class="text-center">

                <div><a target="_blank" class="btn btn-danger" href="{:U('Package/add',['Type'=>2])}" style="color: black">去添加默认渠道包</a></div>

            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    var getMoreActicityUrl = "{:U('Package/getMore')}";
    var getViewUrl = "{:U('Package/view')}";
    $(function () {
        $("#timeDesc").tablesorter();
        $('.tablesorter-header').click(function(){
            if($(this).hasClass('Jdesc')){
                $(this).find('i').text('正序');
                $(this).removeClass('Jdesc');
            }else{
                $(this).find('i').text('降序');
                $(this).addClass('Jdesc');
            }
        })
    });
</script>
<script src="__PUBLIC__/js/uploadify/jquery2.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/artDialog/artDialog.js"></script>

<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/main.js"></script>
<script src="__PUBLIC__/js/package.js"></script>
<script src="__PUBLIC__/js/tablesorter/dist/js/jquery.tablesorter.min.js"></script>
<script src="__PUBLIC__/js/tablesorter/dist/js/jquery.tablesorter.widgets.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/js/tablesorter/dist/css/theme.default.min.css">
</body>
</html>